<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>数组去重</title>
  </head>

  <body>
    <script>
      let nums = [1, 2, 3, 1, 4, 5, 6, 5, 6]
      let num = []
      for (let i = 0; i < nums.length; i++) {
        const element = nums[i]
        if (!num.includes(element)) {
          num.push(element)
        }
      }
      console.log([...num])
    </script>
  </body>
</html>
